import request from '@/utils/request'

export function login (data) {
  return request({
    url: '/api/login',
    method: 'post',
    data
  })
}

export function getInfo (data) {
  return request({
    url: '/api/setting/user/show',
    method: 'post',
    data
  })
}

export function logout () {
  return request({
    url: '/api/logout',
    method: 'post'
  })
}

export function restPassword (data) {
  return request({
    url: '/api/restPassword',
    method: 'post',
    data
  })
}

export function getDictData (key) {
  return request({
    url: '/api/setting/data/key',
    method: 'post',
    data: {
      key
    }
  })
}

export function getDictDatas (keys) {
  return request({
    url: '/api/setting/data/keys',
    method: 'post',
    data: {
      keys
    }
  })
}

export function uploadImg (data) {
  return request({
    url: '/api/update',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}

export function getJobIndex (data) {
  return request({
    url: '/api/setting/job/index',
    method: 'post',
    data
  })
}

export function getAreaIndex (data) {
  return request({
    url: '/api/setting/areas/index',
    method: 'post',
    data
  })
}

export function getIndustry (data) {
  return request({
    url: '/api/setting/industry/index',
    method: 'post',
    data
  })
}

export function showReport (data) {
  return request({
    url: '/api/s3/show',
    method: 'post',
    data
  })
}

export function downloadFile (data) {
  return request({
    url: '/api/s3/download',
    method: 'post',
    responseType: 'blob',
    data
  })
}
